<template>
  <div>
    <el-card>
      <el-row>
        <el-col :span="21">
          <el-form ref="formRef" label-position="top" :model="formData" inline>
            <el-form-item :label="nameList[0]">
              <el-input v-model="formData.code" placeholder="请输入" style="width:370px;margin-right: 20px;" />
            </el-form-item>
            <el-form-item :label="nameList[1]">
              <el-input v-model="formData.name" placeholder="请输入" style="width:370px;margin-right: 20px;" />
            </el-form-item>
            <el-form-item :label="nameList[2]">
              <el-select v-model="formData.states" placeholder="请选择" style="width:370px;margin-right: 20px;">
                <el-option label="全部" value="null" />
                <el-option label="停用" value="0" />
                <el-option label="启用" value="1" />
              </el-select>
            </el-form-item>
          </el-form>
        </el-col>
        <el-col :span="3">
          <el-row style="margin-top:55px">
            <el-col :span="12">
              <el-button type="warning" round @click="$emit('searchFn', formData)">搜索</el-button>
            </el-col>
            <el-col :span="12">
              <el-button round @click="resetBtn">重置</el-button>
            </el-col>
          </el-row>
        </el-col>
      </el-row>
    </el-card>
  </div>
</template>

<script>
export default {
  props: {
    formData: {
      type: Object,
      default: () => {}
    },
    nameList: {
      type: Array,
      default: () => {}
    }
  },
  methods: {
    resetBtn() {
      this.$refs.formRef.resetFields()
      // console.log(this.$refs)
      this.$emit('resetBtn')
      // this.$emit('publicFn', this.formData)
    }
  }
}
</script>

<style>

</style>
